package func;

import java.util.ArrayList;

public class BasicTrigometricFuncs implements FunctionGroup<Double> {
	public String description() {
		return "basetrigometricdouble";
	}
	public ArrayList<Function<Double>> createFunctionGroup() {
		ArrayList<Function<Double>> f = new ArrayList<Function<Double>>();
		
		f.add(new Function<Double>() {
			public Double applyFunction(Double[] param) {
				return Math.cos(param[0]);
			}
			public String description() {
				return "cos";
			}
			public int paramCount() {
				return 1;
			}
			
		});
		
		f.add(new Function<Double>() {
			public Double applyFunction(Double[] param) {
				return Math.acos(param[0]);
			}
			public String description() {
				return "arccos";
			}
			public int paramCount() {
				return 1;
			}
			
		});
		
		f.add(new Function<Double>() {
			public Double applyFunction(Double[] param) {
				return Math.sin(param[0]);
			}
			public String description() {
				return "sin";
			}
			public int paramCount() {
				return 1;
			}
			
		});
		
		f.add(new Function<Double>() {
			public Double applyFunction(Double[] param) {
				return Math.asin(param[0]);
			}
			public String description() {
				return "arcsin";
			}
			public int paramCount() {
				return 1;
			}
			
		});

		f.add(new Function<Double>() {
			public Double applyFunction(Double[] param) {
				return Math.asin(Math.min(Math.max(param[0],-1.0),1.0));
			}
			public String description() {
				return "marcsin";
			}
			public int paramCount() {
				return 1;
			}
			
		});

		f.add(new Function<Double>() {
			public Double applyFunction(Double[] param) {
				return Math.acos(Math.min(Math.max(param[0],-1.0),1.0));
			}
			public String description() {
				return "marccos";
			}
			public int paramCount() {
				return 1;
			}
			
		});

		
		return f;
	}
}
